// SeqList.h
#pragma once
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>

typedef int SLDateType;
typedef struct SeqList
{
  SLDateType *a;
  int size;     // 有效数据大小
  int capacity; // 容量
} SeqList;

// 对数据的管理:增删查改
void SeqListInit(SeqList *ps);
void SeqListDestroy(SeqList *ps);

void SeqListPrint(SeqList *ps);

// 头尾删除
void SeqListPushBack(SeqList *ps, SLDateType x);
void SeqListPushFront(SeqList *ps, SLDateType x);
void SeqListPopFront(SeqList *ps);
void SeqListPopBack(SeqList *ps);

// 顺序表查找
int SeqListFind(SeqList *ps, SLDateType x);
// 顺序表在pos位置插入x
void SeqListInsert(SeqList *ps, int pos, SLDateType x);
// 顺序表删除pos位置的值
void SeqListErase(SeqList *ps, int pos);